package com.cskaoyan.filter;

import org.springframework.web.filter.OncePerRequestFilter;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author 楚夏三分
 * @datetime 2022/12/26 22:07
 * @description: TODO: 增加Filter过滤器, 需要在ApplicationInitializer中重写getServletFilter方法
 */
public class CustomFilter extends OncePerRequestFilter {
    @Override
    protected void doFilterInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, FilterChain filterChain) throws ServletException, IOException {
        System.out.println("Custom Filter");
        filterChain.doFilter(httpServletRequest,httpServletResponse);
    }
}
